package com.warmheart.core.pool;

import javax.validation.constraints.NotNull;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

class WhRunnable implements Runnable {

    private static Logger logger = LoggerFactory.getLogger(WhRunnable.class);

    private String remarks;

    private Runnable runnable;

    WhRunnable(@NotNull String remarks, @NotNull Runnable runnable) {
        super();
        this.remarks = remarks;
        this.runnable = runnable;
    }

    String getRemarks() {
        return remarks;
    }

    @Override
    public void run() {
        logger.info("----------------------------" + this.remarks + "开始----------------------------");
        this.runnable.run();
        logger.info("----------------------------" + this.remarks + "结束----------------------------");
    }
}
